package com.wac.user.client;

import com.alibaba.fastjson.JSONObject;
import com.wac.common.config.FeignConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * @author wuancheng
 * @date 2024/8/26 14:32
 * @description
 * name 或者 value是注册到注册中心的服务的name，通过此方式可以实现负载均衡的效果，contextId为当前client注册到bean的名称
 * fallback为异常处理的返回
 */
@FeignClient(value = "wac-order", contextId = "orderClient", fallback = FeignConfiguration.class)
public interface OrderClient {
    /**
     * 调用order服务的getOrder方法
     *
     * @param param
     * @return
     */
    @PostMapping(value = "/getOrder", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    JSONObject getOrder(JSONObject param);
}
